package com.yhgm.controller;

import com.yhgm.model.entity.Timer;
import com.yhgm.service.impl.TimerServiceImpl;
import com.yhgm.utils.R;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("timer")
public class TimerController {
    @Resource
    private TimerServiceImpl timerService;

    @PostMapping("addTimer")
    public R addTimer(@RequestBody Timer timer) {
        return timerService.addTimer(timer);
    }
    @PutMapping("updateTimer")
    public R updateTimer(@RequestBody Timer timer) {
        return timerService.updateTimer(timer);
    }
    @DeleteMapping("deleteTimer")
    public R deleteTimer(Long id) {
        return timerService.deleteTimer(id);
    }
    @PutMapping("pauseTimer")
    public R pauseTimer(Long id) {
        return timerService.pauseTimer(id);
    }
    @PutMapping("resumeTimer")
    public R resumeTimer(Long id) {
        return timerService.resumeTimer(id);
    }
    @PostMapping("multipleAndFuzzy")
    public R multipleAndFuzzy(@RequestBody Timer timer,int page,int size) {
        return timerService.multipleAndFuzzy(timer,page,size);
    }
}
